﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="Content" table="cmsContent">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Name" type="System.String">
      <column name="Name" not-null="true" />
    </property>
    <property name="FirstPublished" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="FirstPublished" not-null="false" />
    </property>
    <property name="EventStart" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="EventStart" not-null="false" />
    </property>
    <property name="EventEnd" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="EventEnd" not-null="false" />
    </property>
    <property name="SortKey" type="System.String">
      <column name="SortKey" not-null="false" />
    </property>
    <property name="StartPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="StartPublishing" not-null="false" />
    </property>
    <property name="EndPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="EndPublishing" not-null="false" />
    </property>
    <property name="Created" type="System.DateTime">
      <column name="Created" not-null="true" />
    </property>
    <map cascade="all-delete-orphan" inverse="true" name="Translations" table="cmsContentTranslation" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="ContentID" />
      </key>
      <index type="System.Int32">
        <column name="LocaleID" />
      </index>
      <one-to-many class="ContentTranslation" />
    </map>
    <bag name="Pages" table="cmsPageContent" inverse="true" cascade="all-delete-orphan">
      <cache usage="read-write" />
      <key column="ContentID" />
      <one-to-many class="PageContentLink" />
    </bag>
    <bag name="MasterTemplates" table="cmsMasterTemplateContent" inverse="true" cascade="all-delete-orphan">
      <cache usage="read-write" />
      <key column="ContentID" />
      <one-to-many class="MasterTemplateContentLink" />
    </bag>
    <bag name="DetailTemplates" table="cmsDetailTemplateContent" inverse="true" cascade="all-delete-orphan">
      <cache usage="read-write" />
      <key column="ContentID" />
      <one-to-many class="DetailTemplateContentLink" />
    </bag>
    <bag name="Categories" table="cmsContentCategory" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="ContentID" />
      </key>
      <many-to-many class="Category">
        <column name="CategoryID" />
      </many-to-many>
    </bag>
    <bag name="Comments" cascade="all-delete-orphan" inverse="true" table="cmsComment">
      <cache usage="read-write" />
      <key column="ContentID" />
      <one-to-many class="Comment" />
    </bag>
    <many-to-one class="Site" name="Site">
      <column name="SiteID" not-null="true" />
    </many-to-one>
    <many-to-one class="Administrator" name="CreatedBy">
      <column name="CreatedByID" not-null="true" />
    </many-to-one>
    <bag name="AllowedAdministratorGroups" table="cmsAdministratorGroupAllowedContent" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="ContentID" />
      </key>
      <many-to-many class="AdministratorGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="DeniedAdministratorGroups" table="cmsAdministratorGroupDeniedContent" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="ContentID" />
      </key>
      <many-to-many class="AdministratorGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="RequiredUserGroups" table="cmsContentRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="ContentID" />
      </key>
      <many-to-many class="UserGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="DeselectedUserGroups" table="cmsContentDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="ContentID" />
      </key>
      <many-to-many class="UserGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
  </class>
</hibernate-mapping>